from nonebot import on_command,CommandSession
from nonebot import on_natural_language, NLPSession, IntentCommand
import nonebot
import sys,os

# bot = nonebot.get_bot()
# SUPERUSERS = bot.config.SUPERUSERS

save = ''

@on_command('encry_talk',aliases=['加密通话',],only_to_me=True)
async def _ec(session:CommandSession):
    uid = session.event.user_id
    # if not uid == '2392320844':
    #     return
    msg = session.get('msg',prompt='参数?')
    ec_repo = ''
    if 'CQ' in msg:
        ec_repo = msg
    elif 'CQ' not in msg and '?xml' in msg:
        ec_repo = f'[CQ:xml,data={msg}]'
    save = ec_repo
    await session.send(save)
    await session.send('哒哒哒哒')
    

@_ec.args_parser
async def _(session: CommandSession):
    stripped_arg = session.current_arg_text.strip()
    if session.is_first_run:
        if stripped_arg:
            session.state['msg'] = stripped_arg
        return
        
    if not stripped_arg:
        session.pause('不能为空,重新输入')
        
    session.state[session.current_key] = stripped_arg


